/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.landmark;

import java.io.File;
import javax.swing.filechooser.FileFilter;


/**
 *
 * @author computer
 */
public class FileFiltering extends FileFilter{
   private final String[] okFileExtensions = 
     new String[] {"csv","txt","xls"};

   @Override
   public boolean accept(File file)
   {
     for (String extension : okFileExtensions)
     {
       if (file.getName().toLowerCase().endsWith(extension))
       {
         return true;
       }
     }
     
     if(file.isDirectory()) {
         return true;
     }
     return false;
   }
   
   @Override
   public String getDescription() {
       return  desc;
   }
   
   private String desc="csv,txt,xls";
 }
